tools/libxc: add a check in xc_hypercall_buffer_free_pages macro
authorYang Hongyang <yanghy@cn.fujitsu.com>
Thu, 14 May 2015 08:55:08 +0000 (16:55 +0800)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 14 May 2015 12:02:05 +0000 (13:02 +0100)
commitebbbf9a1fed35105b16cb5dd70501ed3b5fde127
tree1309add5c993f44745b71a6e57b193b1450ef54d
parent22c06289dccb2c45ed47ee39d285e7ee24174f1a
tools/libxc: add a check in xc_hypercall_buffer_free_pages macro

When we use a DECLARE_HYPERCALL_BUFFER_SHADOW it defines a user
pointer '_name' and a shadow xc_hypercall_buffer_t.
When calling xc_hypercall_buffer_free_pages(_xch, _name, _nr),
the complier will report '_name' unused error, because
xc_hypercall_buffer_free_pages() is a MACRO and '_name' is
transparently converted to the hypercall buffer. it confuses
the caller because xc_hypercall_buffer_free_pages() looks
like a function and takes '_name' as an arg.
Add an if check to let the compiler think we are actually
using the argument '_name'.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
[ ijc -- some rewording of the commit message ]
tools/libxc/include/xenctrl.h